package com.ggh.interceptor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class UserInterceptorHandler extends HandlerInterceptorAdapter {
    @Override
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
            throws Exception {
    	boolean filter = false;
	        if (request.getRequestURI().equals("/login")){
	        filter =true;
			}
	        if(!filter){
	        	response.sendRedirect("/login");
	        	filter=true;
	        }
        return filter ; 
    }

}